You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This pull request enhances the camera stream functionality by adding logic to handle different middleware server scenarios. It introduces new props, constants, and state variables to store and select the appropriate middleware hostname for each camera. It also updates the API calls and the UI components to use the new logic. It affects the files ONVIFCamera.tsx, Feed.tsx, and useMSEplayer.ts.
Add middleware_address and location_middleware properties to ICameraAssetState interface to store the hostnames of the middleware servers for the camera stream and the location of the camera (link)
Define fallbackMiddleware and currentMiddleware constants to provide a default middleware hostname for the camera stream based on the availability of the middlewareHostname prop and the asset object in the ONVIFCamera component (link)
Use currentMiddleware constant instead of facilityMiddlewareHostname in the API calls to get the preset data and to pass the prop to the AddPresetModal component in the ONVIFCamera component (link, link)
Remove the definition of fallbackMiddleware constant from the ONVIFCamera component as it is now passed as a prop from the Feed component (link)
Rename cameraMiddlewareHostname state variable to facilityMiddlewareHostname and add middleware_address and location_middleware properties to cameraAsset state object to store the hostnames of the middleware servers for the camera stream and the location of the camera in the Feed component (link, link)
Set the value of facilityMiddlewareHostname state variable to the value of res.data.middleware_address in the API call to get the facility details in the Feed component (link)
Define fallbackMiddleware and currentMiddleware constants to provide a default middleware hostname for the camera stream based on the availability of the cameraAsset.middleware_address and the cameraAsset.location_middleware properties in the Feed component (link)
Use currentMiddleware constant instead of facilityMiddlewareHostname in the URL for the camera stream, the config object passed to the useMSEMediaPlayer hook, and the dependency array of the useEffect hook that calls the getBedPresets function in the Feed component (link, link, link)
@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WHAT
🤖 Generated by Copilot at 8fba4f2
This pull request enhances the camera stream functionality by adding logic to handle different middleware server scenarios. It introduces new props, constants, and state variables to store and select the appropriate middleware hostname for each camera. It also updates the API calls and the UI components to use the new logic. It affects the files
ONVIFCamera.tsx
,Feed.tsx
, anduseMSEplayer.ts
.@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
HOW
🤖 Generated by Copilot at 8fba4f2
middleware_address
andlocation_middleware
properties toICameraAssetState
interface to store the hostnames of the middleware servers for the camera stream and the location of the camera (link)fallbackMiddleware
andcurrentMiddleware
constants to provide a default middleware hostname for the camera stream based on the availability of themiddlewareHostname
prop and theasset
object in theONVIFCamera
component (link)currentMiddleware
constant instead offacilityMiddlewareHostname
in the API calls to get the preset data and to pass the prop to theAddPresetModal
component in theONVIFCamera
component (link, link)fallbackMiddleware
constant from theONVIFCamera
component as it is now passed as a prop from theFeed
component (link)cameraMiddlewareHostname
state variable tofacilityMiddlewareHostname
and addmiddleware_address
andlocation_middleware
properties tocameraAsset
state object to store the hostnames of the middleware servers for the camera stream and the location of the camera in theFeed
component (link, link)facilityMiddlewareHostname
state variable to the value ofres.data.middleware_address
in the API call to get the facility details in theFeed
component (link)fallbackMiddleware
andcurrentMiddleware
constants to provide a default middleware hostname for the camera stream based on the availability of thecameraAsset.middleware_address
and thecameraAsset.location_middleware
properties in theFeed
component (link)currentMiddleware
constant instead offacilityMiddlewareHostname
in the URL for the camera stream, the config object passed to theuseMSEMediaPlayer
hook, and the dependency array of theuseEffect
hook that calls thegetBedPresets
function in theFeed
component (link, link, link)